require 'help'
require 'file_analyser'
require 'grin_generator'
require 'grin_exec'
require 'story_teller'

class BackupStorage

  attr_reader :size
  attr_reader :all_help

  #``````````````````
  # constructor
  #``````````````````
  
  def initialize(storyteller, size = nil)
    @storyteller = storyteller
    @size = size
    @all_help = []
  end
  
  #``````````````````
  # interface
  #``````````````````  

  def run
    input = nil
    while parse(input) 
      input = gets.chomp
    end
  end

  def parse(input)
    start and return true if input.nil?
    input.strip!
    return false if input == "end"
    return true
  end

  #``````````````````
  # private methods
  #``````````````````  

  private
  
    def start
      @all_help << Help.backup_welcome(0, @storyteller.size)
    end

end